﻿using EFCore.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SService;

namespace WMSWeb.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class PDinventory_detailsController : ControllerBase
    {
        private readonly WmssystemContext myDb;
        private readonly PDinventory_detailsS PDinventory_detailsS;

        public PDinventory_detailsController(WmssystemContext myDb, SService.PDinventory_detailsS PDinventory_detailsS)
        {
            this.myDb = myDb;
            this.PDinventory_detailsS = PDinventory_detailsS;
        }
        /// <summary>
        /// 盘点明细表查询全部
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public Task<List<sys_inventory_details>> Query()
        {
            return PDinventory_detailsS.Query();
        }
        /// <summary>
        /// 盘点明细添加
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<ActionResult<int>> Add(sys_inventory_details add)
        {
            // 调用服务层的方法执行添加操作
            return await PDinventory_detailsS.Add(add);
        }
    }
}
